home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_12_10
/
saks
/
comstr6.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-08
|
710b
|
43 lines
Listing 8 - Non-inline member function definitions for str objects that
can be placed in a container of common *.
//
// comstr6.cpp - a "common" str type for containable str objects
//
#include "comstr6.h"
common &comstr::operator=(const common &c)
{
e = ((const comstr &)c).e;
return *this;
}
common *comstr::dup() const
{
return new comstr(*this);
}
size_t comstr::size() const
{
return sizeof(comstr);
}
ostream &comstr::write(ostream &s) const
{
return s << e;
}
istream &comstr::read(istream &s)
{
return s >> e;
}
comstr::~comstr() { }
comstr::operator str &()
{
return e;
}